package jju.game;

public class GetDistance {
    public int distance(int x1, int y1, int r1, int x2, int y2, int r2){
        int flag = 0;
        Central central1 = new Central(x1,y1, r1);
        Central central2 = new Central(x2,y2, r2);

        if (Math.sqrt((central1.x-central2.x)*(central1.x-central2.x) +
                (central1.y-central2.y)*(central1.y-central2.y)) < Math.max(r1,r2)){
            if (r1 > r2){
                return 1;
            } else if (r1 < r2){
                return 2;
            }
        }

        return flag;
    }
}



class Central{
    int x, y;
    Central(int x, int y, int r){
        this.x = x+r;
        this.y = y+r;
    }

}
